@extends('admin::layouts.master')
@section('title') 维修店服务列表 @endsection
@section('tab')
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body ">
                        <form class="layui-form layui-col-space5">
                            <div class="layui-input-inline layui-show-xs-block">
                                <input type="text" name="name" placeholder="服务名称" value="{{$data['name']}}"
                                       autocomplete="off" class="layui-input">
                            </div>

                            <div class="layui-input-inline layui-show-xs-block">
                                <select name="type">
                                    <option value="">选择类型</option>
                                    @if($list['type'])
                                        @foreach($list['type'] as $k => $v)
                                            <option value="{{$v['id']}}" @if($data['type']==$v['id']) selected @endif>{{$v['title']}}</option>
                                        @endforeach
                                    @endif
                                </select>
                            </div>

                            <div class="layui-input-inline layui-show-xs-block">
                                <button class="layui-btn" lay-submit="" lay-filter="sreach">
                                    <i class="layui-icon">&#xe615;</i>
                                </button>
                                <button class="layui-btn" onclick="location.reload()">
                                    <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
                                </button>
                            </div>
                        </form>
                    </div>
                    <div class="layui-card-body">
                        <button class="layui-btn" onclick="xadmin.open('添加服务','{{route('admin_repairstore_create')}}',$(window).width(),$(window).height())">
                            <i class="layui-icon"></i>添加服务
                        </button>
                    </div>
                    <div class="layui-card-body layui_overflow_y ">
                        <table class="layui-table layui-form">
                            <thead>
                            <tr>
                                <th>编号</th>
                                <th>服务名称</th>
                                <th>服务类型</th>
                                <th>价格</th>
                                <th>上/下架</th>
                                <th>创建时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>

                            @foreach($list['data'] as $key=>$value)
                                <tr>
                                    <td>{{$value['id']}}</td>
                                    <td>{{$value['name']}}</td>
                                    <td>{{$value['type']['title']}}</td>
                                    <td>{{$value['price']}}</td>
                                    <td>{{$value['status']==1?'上架':'下架'}}</td>
                                    <td>{{$value['created_at']}}</td>
                                    <td class="td-manage">
                                        <a title="编辑" onclick="xadmin.open('编辑','{{route('admin_repairstore_edit',['id'=>$value['id']])}}',$(window).width(),$(window).height())" href="javascript:;">
                                            <i class="layui-icon"></i>
                                        </a>
                                        {{--<a title="删除" class="ajax_member_del" data-href="{{route('admin_repairstore_del',['id'=>$value['id']])}}" data-title="确定删除吗？请谨慎操作" href="javascript:;">
                                            <i class="layui-icon">&#xe640;</i>
                                        </a>--}}
                                    </td>
                                </tr>
                            @endforeach
                            @if(empty($list['data']))
                                <td colspan="66" align="center">暂无数据</td>
                            @endif
                            </tbody>
                        </table>
                    </div>
                    <div class="layui-card-body ">
                        <div class="page">
                            {{$list['page_link']}}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

@endsection


@section('tab_js')
    <script>
        layui.use(['laydate', 'form'],
            function () {

            }
        );



    </script>
@endsection




